/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dbconnect;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.UnicastRemoteObject;

/**
 *
 * @author Tuyen
 */
public class DbSever {

    public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException {
        DBConnect db=new DBConnect();
        LocateRegistry.createRegistry(1433);
        System.out.println("Exporting...");
        UnicastRemoteObject.exportObject(db, 1433);
        Naming.bind("rmi://localhost:1433/MyDB", db);
        System.out.println("Registed!");
    }
}
